package com.cddata.util;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {

	private static final SessionFactory sessionfactory ;
	static {
		try{
			sessionfactory = new Configuration().configure().buildSessionFactory();
//			System.out.println("created factory"+ sessionfactory.openSession());
		}catch (Throwable e) {
//			System.out.println( " Error in creating session " );
			throw new ExceptionInInitializerError(e) ;
		}
	}

	public static SessionFactory getSessionFactory() {
		return sessionfactory;
	}
}
